import java.lang.Throwable;
import java.io.*;

public class Test14 {
    public static void main(String[] args) throws IOException {
        String fileName = "D:\\java\\Hello.doc";

        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
            
            writer.write("java周四晚考试!");
            writer.newLine();
            writer.write("我想出去玩!");
            writer.newLine();

            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            System.out.println("end");
        }
    }
}
